import java.util.Random;
import java.util.Scanner;

/**
 * Created by dllo on 18/3/31.
 */
public class Test09 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        Random random = new Random();
        int money = 5000;
        while (money != 0) {
            System.out.println("输入大或者小" + "1是大,2是小" + ":");
            int d = scanner.nextInt();
            int a = random.nextInt(6) + 1;
            int b = random.nextInt(6) + 1;
            int c = random.nextInt(6) + 1;
            int sum = a + b + c;
            System.out.println(a + "," + b + "," + c);
            if (sum < 10) {
                System.out.println(sum + ":" + "小");
            } else {
                System.out.println(sum + ":" + "大");
            }
            switch (d) {
                case 1:
                    if (sum >= 11 && sum <= 18) {
                        System.out.println("赢");
                        money += 5000;
                        System.out.println("剩余钱是" + money);
                    } else {
                        System.out.println("输");
                        money -= 5000;
                        System.out.println("剩余钱是" + money);
                    }
                    break;
                case 2:
                    if (sum >= 3 && sum <= 10) {
                        System.out.println("赢");
                        money += 5000;
                        System.out.println("剩余钱是" + money);
                    } else {
                        System.out.println("输");
                        money -= 5000;
                        System.out.println("剩余钱是" + money);
                    }
            }
        }
        System.out.println("请充值");
    }
}
